const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)

const plugins = [
  [
    "import",
    { libraryName: "ant-design-vue", libraryDirectory: "es", style: true }
  ],
  [
    "import",
    {
      "libraryName": "vxe-table",
      "style": true // 样式是否也按需加载
    },
    "vxe-table"
  ],
  [
    "component",
    {
      "libraryName": "element-ui",
      "styleLibraryName": "theme-chalk"
    }
  ]
]
if (IS_PROD) {
  plugins.push('transform-remove-console')
}

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins
}
